package com.hxzy.shop.commodity.utils;

/**
 * @author qy
 * @Description:
 * @date:2021/8/10 19:44
 */
public class MerchantThreadLocalUtils {
    private final  static ThreadLocal<Long> merchantIdThreadLocal = new ThreadLocal<>();

    /**
     * 设置当前线程中的用户
     * @param id
     */
    public static void setMerchantId(Long id){
        merchantIdThreadLocal.set(id);
    }

    /**
     * 获取线程中的用户
     * @return
     */
    public static Long getMerchantId( ){
        return merchantIdThreadLocal.get();
    }
}
